<html>
<head>
	<title>Title</title>
	<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
	<script>
	function test() {
		String.prototype.repeat=function(times) {
			var a=[];
			for(;times>0;times--) {
				a.push(this);
			}
			return a.join();
		};
		String.prototype.repeat2=function(times) {
			var a="";
			for(;times>0;times--) {
				a+=this;
			}
			return a;
		}

		for(var c=0;c<5;c++) {
			var t1=new Date();
			for(var i=0;i<2000;i++) {
				"this is a test string".repeat(500);
			}
			var time1=(new Date()-t1);

			var t1=new Date();
			for(var i=0;i<2000;i++) {
				"this is a test string".repeat2(500);
			}
			var time2=(new Date()-t1);
			document.getElementById("result").innerHTML+=time1+" : "+time2+"</br>"
		}
	}
	</script>
</head>
<body onload="test()">
	<p>["",""].join() : ""+""</p>
	<span id="result">
	</span>
</body>

</html>
